function grr  = HoloGrating( )
%HOLOGRATING Summary of this function goes here
%   Detailed explanation goes here

sizeX=35;
sizeY=35;
res=10;
%grr=GaussianBeam(SizeX,SizeY,phi,res,w0,zOffset,rOffset);
%-12
lambda=1.31;
w01=10;
w02=1.78;
theta=45;
grrRed=GaussianBeam(sizeX,sizeY,theta,res,w01,0,0,lambda);
grrRed=grrRed+GaussianBeam(sizeX,sizeY,-theta,res,w02,300,0,lambda);
lambda=0.405;
w01=sqrt(0.405/1.31*w01^2);
w02=sqrt(0.405/1.31*w02^2);
theta=asin(0.405/1.31 *   sin(theta*pi/180) )*180/pi;

theta
grrBlue=GaussianBeam(sizeX,sizeY,theta,res,w01,0,0,lambda);
grrBlue=grrBlue+GaussianBeam(sizeX,sizeY,-theta,res,w02,1000,0,lambda);
for x=1:sizeY*res
	for y=1:sizeX*res
		%for ph=1:10
			
			grrBlue(x,y)=(grrBlue(x,y)* conj(grrBlue(x,y)) );
			grrRed(x,y)=(grrRed(x,y)* conj(grrRed(x,y)) );
		%end
	end
end

%figure(1);
grrBlue=grrBlue/ max(max(grrBlue))*0.01;
grrRed=grrRed/ max(max(grrRed))*0.01;
%h=surf(fftshift(fft2(fftshift(grrBlue)))));
%fftGrr=real(fftshift(fft2(grrBlue,300,1000)));


%fttGrr(sizeX*res/2,sizeY*res/2)=0;
%h=surf(real(fftshift(fft2(fftshift(grrBlue),10 ,150 ))));
%h=surf(grrBlue);
%set(h,'edgecolor','none');

%figure(2);
%h=surf(real(fftshift(fft2(fftshift(grrRed),10,150))));
%h=surf(grrRed);
%set(h,'edgecolor','none');
%figure(3);
%h=surf(real(fftshift(fft2(fftshift(grrRed),10,150))));
h=surf(grrRed);
%set(h,'edgecolor','none');
FileIO(grrRed,res);
